<?php

class Zf24_Application_Resource_View extends Zend_Application_Resource_View
{

    /**
     * Retrieve view object
     *
     * @return Zend_View
     */
    public function getView()
    {
        if (null === $this->_view) {
            $options = $this->getOptions();
            $this->_view = new Zend_View($options);
        }

        $this->_view->doctype('XHTML1_STRICT');
        $this->_view->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8');
        $this->_view->headTitle('ZF24 Application');
        $this->_view->headTitle()->setSeparator(' :: ');
        
        $this->_view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper');

        $this->_view->dojo()
            ->setLocalPath('/js/dojo/dojo/dojo.js')
            ->setDjConfigOption('parseOnLoad', false)
            ->setDjConfigOption('usePlainJson', true)
            ->addStylesheetModule('dijit.themes.soria')
            ;
            
        if (isset($options['doctype'])) {
            $this->_view->doctype($options['doctype']);
        }

        return $this->_view;
    }

}